#!/bin/bash
#=======================
# Author : Ali Moradzade
# Created: 2022/01/09
#=======================

# Modifying a set trap

trap "echo ' Sorry... Ctrl-C is trapped.'" SIGINT

count=1
while [ $count -le 5 ]
do
	echo "Loop #$count"
	sleep 1
	count=$[ $count + 1 ]
done

trap "echo ' I modified the trap!'" SIGINT

count=1
while [ $count -le 5 ]
do
	echo "Second Loop #$count"
	sleep 1
	count=$[ $count + 1 ]
done
